//---------------------------------------------------------------------
// <copyright file="CsdlSemanticsRowTypeDefinition.cs" company="Microsoft">
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//---------------------------------------------------------------------

using Microsoft.Data.Edm.Csdl.Internal.Parsing.Ast;

namespace Microsoft.Data.Edm.Csdl.Internal.CsdlSemantics
{
    /// <summary>
    /// Provides semantics for CsdlRowType.
    /// </summary>
    internal class CsdlSemanticsRowTypeDefinition : CsdlSemanticsStructuredTypeDefinition, IEdmRowType
    {
        private readonly CsdlRowType row;

        public CsdlSemanticsRowTypeDefinition(CsdlSemanticsSchema context, CsdlRowType row)
            : base(context, row)
        {
            this.row = row;
        }

        public override EdmTypeKind TypeKind
        {
            get { return EdmTypeKind.Row; }
        }

        public override IEdmStructuredType BaseType
        {
            get { return null; }
        }

        protected override CsdlStructuredType MyStructured
        {
            get { return this.row; }
        }
    }
}
